package com.itrus.auth.demo.person.basic;

import com.itrus.auth.demo.core.Config;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**
 * @author : peigen
 * @since: 2023/8/1 16:59
 */
@Slf4j
public class BankCardFourAuth extends PersonBasicAuth {

    protected String SERVICE_CODE = "idc0006";


    public BankCardFourAuth(Config config) {
        super.config = config;
    }


    /**
     * 银行卡四要素
     *
     * @param name     姓名
     * @param idCard   身份证号
     * @param bankcard 银行卡号
     * @param mobile   手机号
     */
    public void auth(String name, String idCard, String bankcard, String mobile) {
        Map<String, String> requestMap = getRequestMap(name, idCard);
        requestMap.put("mobile", mobile);
        requestMap.put("bankcard", bankcard);

        doRequest(REQUEST_PATH, requestMap);
    }

    @Override
    public String getServiceCode() {
        return SERVICE_CODE;
    }
}
